import { Schema } from "mongoose";

var mongoose = require("mongoose");
//var Schema = mongoose.Schema;

var userSohema = new mongoose.Schema({
    "userId":String,
    "userName":String,
    "userPwd":String,
    "orderList":Array,
    "salePrice":Number,
    "cartList":{
        "productId":String,
        "productName":String,
        "salePrice":String,
        "productImage":String,
        "productNum":String
    },
    "addressList":Array
});

var productSchema = new Schema({
    "productId":{type:String},
    "productName":String,
    "salePrice":Number,
    "productImage":String
});

module.exports.userSohema = mongoose.model("User",userSohema);
module.exports.productSchema = mongoose.model("Good",productSchema);